package com.ykdl.member.kid.marketcard;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.sitech.oncon.barcode.core.CaptureActivity;
import com.ykdl.member.constant.KidAction;
import com.ykdl.member.constant.KidConfig;
import com.ykdl.member.kid.R;
import com.ykdl.member.kid.gears.BaseScreen;
import com.ykdl.member.kid.gears.WebViewActivity;
import com.ykdl.member.kid.util.AccessTokenKeeper;

public class MarketcardHelpAandIntro extends BaseScreen{
	
	private static AccessTokenKeeper mTokenKeeper;
	private String url = null;
	private  Boolean isHelp =false;
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setTopTitle("", 0, R.drawable.back_bg, new OnClickListener() {
			@Override
			public void onClick(View v) {
				
				finish();
			}
		}, 0, 0, null, R.drawable.title_bg, false);
		 isHelp = this.getIntent().getBooleanExtra(KidAction.IS_GONE_BT, false);
		setContent(R.layout.cardintrowebview_xml);
		if (isHelp) {
			findViewById(R.id.go_ss).setVisibility(View.VISIBLE);
		}else {
			findViewById(R.id.go_ss).setVisibility(View.GONE);
		}
		mTokenKeeper = new AccessTokenKeeper(this);
		inint();
	}
	
	private void inint() {
		findViewById(R.id.go_ss).setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				go(CaptureActivity.class);
			}
		});
		if (isHelp) {
			url=KidConfig.HSH_HELP+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();;
		}else {
			url=KidConfig.GET_CARD_INTRO+"?"+mTokenKeeper.getmAccessTokenTitle()+"="+mTokenKeeper.getmAccessToken();;
		}
		if (isHelp) {
			setTopNav("帮助");
		}else {
			setTopNav("说明");
		}
		WebView webView =  (WebView)findViewById(R.id.webView);
		mTokenKeeper = new AccessTokenKeeper(this);
		webView.loadUrl(url);
	}
		
	
	

}
